/**
 * 
 */
package com.acme.bankapp.domain.bank;

/**
 * @author Labun Konstantin
 * 
 */
public class Bank {

	private static final int CLIENTS_MAX = 10;
	private Client[] clients = new Client[CLIENTS_MAX];

	public void addClient(Client newClient) {
		for (int i = 0; i < CLIENTS_MAX; i++) {
			if (clients[i] == null) {
				clients[i] = newClient;
				break;
			}
		}
	}

	/**
	 * @return the clients
	 */
	public Client getClient(String clientName) {
		Client result = null;
		for (int i = 0; i < CLIENTS_MAX; i++) {
			if (clients[i] != null && clients[i].getName().equals(clientName)) {
				result = clients[i];
			}
		}
		return result;
	}

	/**
	 * @return the clients
	 */
	public Client[] getClients() {
		return clients;
	}
}
